﻿create or replace package PKG_STDPATTERN_ROLE is

  -- Author  : HY
  -- Created : 2012-11-9 오후 5:55:37
  -- Purpose : 패턴규칙 패키지 (추가, 수정, 삭제)

  -- Public function and procedure declarations
  procedure ADD_STDPATTERN_ROLE (PATTERN_OBJECTID_IN IN NUMBER, PATTERN_SECTION_IN IN NUMBER, FORMAT_IN IN VARCHAR2, CREATE_USER_IN NUMBER);
  procedure UPDATE_STDPATTERN_ROLE (OBJECTID_IN IN NUMBER, PATTERN_OBJECTID_IN IN NUMBER, PATTERN_SECTION_IN IN NUMBER, FORMAT_IN IN VARCHAR2, MODIFY_USER_IN IN NUMBER);
  procedure DELETE_STDPATTERN_ROLE (OBJECTID_IN IN NUMBER);
end PKG_STDPATTERN_ROLE;







create or replace package body PKG_STDPATTERN_ROLE as

  -- Function and procedure implementations
  -- 추가
  procedure ADD_STDPATTERN_ROLE (PATTERN_OBJECTID_IN IN NUMBER, PATTERN_SECTION_IN IN NUMBER, FORMAT_IN IN VARCHAR2, CREATE_USER_IN NUMBER) is
  begin
       INSERT INTO STDPATTERN_ROLE (OBJECTID, PATTERN_OBJECTID, PATTERN_SECTION, FORMAT, CREATE_USER)
       VALUES (SEQ_STDPATTERN_ROLE.NEXTVAL, PATTERN_OBJECTID_IN, PATTERN_SECTION_IN, FORMAT_IN, CREATE_USER_IN);
  end ADD_STDPATTERN_ROLE;

  -- 수정
  procedure UPDATE_STDPATTERN_ROLE (OBJECTID_IN IN NUMBER, PATTERN_OBJECTID_IN IN NUMBER, PATTERN_SECTION_IN IN NUMBER, FORMAT_IN IN VARCHAR2, MODIFY_USER_IN IN NUMBER) is
  begin
       UPDATE STDPATTERN_ROLE A SET A.PATTERN_OBJECTID = PATTERN_OBJECTID_IN, A.PATTERN_SECTION = PATTERN_SECTION_IN, A.FORMAT = FORMAT_IN, A.MODIFY_DATE = SYSDATE, A.MODIFY_USER = MODIFY_USER_IN WHERE A.OBJECTID = OBJECTID_IN;
  end UPDATE_STDPATTERN_ROLE;

  -- 삭제
  procedure DELETE_STDPATTERN_ROLE (OBJECTID_IN IN NUMBER) is
  begin
       DELETE FROM STDPATTERN_ROLE A WHERE A.OBJECTID = OBJECTID_IN;
  end DELETE_STDPATTERN_ROLE;
end PKG_STDPATTERN_ROLE;
